package com.jml.基础;

import com.jml.基础.entity.MemberEntity;
import com.jml.基础.mapper.UserMapper;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;




@RestController
public class MemberController {
    @Autowired
    private UserMapper userMapper;

    /**
     * @Description:
     * @param
     * @return:java.util.List<com.jml.基础.entity.MemberEntity>
     * cacheNames：表示一个文件夹
     * key：表示文件夹中的东西，是真正缓存的key，可以理解为集合
     * ##members
     * ####getListMembers,key上面一定要加单引号否则就会报错
     */
    @Cacheable(cacheNames = "members", key = "'getListMembers'")
    @RequestMapping("/getListMembers")
    public List<MemberEntity> getListMembers() {
        return userMapper.findMemberAll();
    }
    
}
